Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next

The High-Level Event Message Structure

You can search your application's high-level event queue for a specific high-level event by using the GetSpecificHighLevelEvent function (GetSpecificHighLevelEvent) and providing a filter function. Your filter function receives a pointer to a high-level event message structure that contains information about a high-level event.

For information on getting a function descriptor for your filter function, see "Filter Function Pointer and Macro" . For information on how to define a filter function, see "Filter Function for Searching the High-Level Event Queue" .

A structure of type HighLevelEventMsg defines a high-level event message structure.

struct HighLevelEventMsg {                  /* high-level event message structure */
    unsigned short          HighLevelEventMsgHeaderLength;  /* reserved */  
    unsigned short          version;                        /* reserved */
    unsigned long           reserved1;                      /* reserved */
    EventRecord             theMsgEvent;                    /* event record of
                                                            /* high-level event */
    unsigned long           userRefCon;                     /* user reference
                                                            /* constant */
    unsigned long           postingOptions;             /* reserved */
    unsigned long           msgLength;                  /* reserved */};
typedef struct HighLevelEventMsg HighLevelEventMsg;
typedef HighLevelEventMsg *HighLevelEventMsgPtr,
                                    **HighLevelEventMsgHandle,
                                    **HighLevelEventMsgHdl;
HighLevelEventMsgHeaderLength
Reserved for use by the Event Manager.
version
Reserved for use by the Event Manager.
reserved1
Reserved for use by the Event Manager.
theMsgEvent
The event record of a high-level event. Your filter function can compare the fields of this event record to determine whether the high-level event is the desired event. If your filter function finds the desired event, it should call AcceptHighLevelEvent AcceptHighLevelEvent to accept the event and remove the event from the high-level event queue, and return true as its function result.
userRefCon
A unique number that identifies the communication associated with this event.
postingOptions
Reserved for use by the Event Manager.
msgLength
Reserved for use by the Event Manager.

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next